Repository navigation
fix(ui): send priority when creating condition rules - #1663
Open
dongyikuan919 wants to merge 1 commit into
Open
dongyikuan919 wants to merge 1 commit into
dongyikuan919 wants to merge 1 commit into
Conversation
|
robocanic
reviewed
Dec 5, 2026
robocanic
left a comment
Contributor
There was a problem hiding this comment.
优点
- 改动范围小且精准:
addByFormView.vue中解构priority并仅在非空时写入 payload(...(isNil(priority) ? {} : { priority })),与后端ConditionRule.Priority(pkg/console/model/condition_rule.go,json:"priority")契约一致;留空时省略字段,由服务端使用默认值。 priority: null as number | null的类型标注让a-input-number的v-model:value与 payload 类型更准确。- 新增的
addByFormView.spec.ts同时覆盖了“填写后提交”与“留空则省略”两个分支,断言的是真实的请求 payload,而不是实现细节。
问题
Critical
未发现。
Important
未发现。
总体评估
Ready to merge? Yes
未发现明显的 Critical / Important 问题,修复逻辑正确,测试能够覆盖核心行为。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Fixes #1659. Creating a condition rule from the form now includes the entered numeric priority in the POST payload. A blank field leaves the property omitted so the server can apply its default.
Evidence
12and failed because the API mock received nopriorityfield.priority: 12. A second case verifies that leaving the field empty still omits it.yarn testpassed all 77 tests andyarn vite buildcompleted. The new test passes ESLint. The Vue file reports the same parser error on this branch and pristinedevelop.Area